
 package com.ami.kvm.jviewer.avistream;
 
 import java.io.FilterOutputStream;
 import java.io.IOException;
 import java.io.OutputStream;
 import java.io.UnsupportedEncodingException;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 public class DataChunkOutputStream
   extends FilterOutputStream
 {
   protected long written;
   
   public DataChunkOutputStream(OutputStream paramOutputStream)
   {
     super(paramOutputStream);
   }
   
 
 
   public void writeType(String paramString)
     throws IOException
   {
     if (paramString.length() != 4) {
       throw new IllegalArgumentException("type string must have 4 characters");
     }
     try
     {
       this.out.write(paramString.getBytes("ASCII"), 0, 4);
       incCount(4);
     } catch (UnsupportedEncodingException localUnsupportedEncodingException) {
       throw new InternalError(localUnsupportedEncodingException.toString());
     }
   }
   
 
 
 
 
 
 
 
   public final void writeByte(int paramInt)
     throws IOException
   {
     this.out.write(paramInt);
     incCount(1);
   }
   
 
 
 
 
 
 
 
 
 
 
 
 
   public synchronized void write(byte[] paramArrayOfByte, int paramInt1, int paramInt2)
     throws IOException
   {
     this.out.write(paramArrayOfByte, paramInt1, paramInt2);
     incCount(paramInt2);
   }
   
 
 
 
 
 
 
 
 
 
 
 
   public synchronized void write(int paramInt)
     throws IOException
   {
     this.out.write(paramInt);
     incCount(1);
   }
   
 
 
 
 
 
 
 
   public void writeInt(int paramInt)
     throws IOException
   {
     this.out.write(paramInt >>> 0 & 0xFF);
     this.out.write(paramInt >>> 8 & 0xFF);
     this.out.write(paramInt >>> 16 & 0xFF);
     this.out.write(paramInt >>> 24 & 0xFF);
     incCount(4);
   }
   
 
 
 
 
   public void writeUInt(long paramLong)
     throws IOException
   {
     this.out.write((int)(paramLong >>> 0 & 0xFF));
     this.out.write((int)(paramLong >>> 8 & 0xFF));
     this.out.write((int)(paramLong >>> 16 & 0xFF));
     this.out.write((int)(paramLong >>> 24 & 0xFF));
     incCount(4);
   }
   
 
 
 
 
   public void writeShort(int paramInt)
     throws IOException
   {
     this.out.write(paramInt >>> 0 & 0xFF);
     this.out.write(paramInt >> 8 & 0xFF);
     incCount(2);
   }
   
   public void writeLong(long paramLong) throws IOException {
     this.out.write((int)(paramLong >>> 0) & 0xFF);
     this.out.write((int)(paramLong >>> 8) & 0xFF);
     this.out.write((int)(paramLong >>> 16) & 0xFF);
     this.out.write((int)(paramLong >>> 24) & 0xFF);
     this.out.write((int)(paramLong >>> 32) & 0xFF);
     this.out.write((int)(paramLong >>> 40) & 0xFF);
     this.out.write((int)(paramLong >>> 48) & 0xFF);
     this.out.write((int)(paramLong >>> 56) & 0xFF);
     incCount(8);
   }
   
   public void writeUShort(int paramInt) throws IOException {
     this.out.write(paramInt >>> 0 & 0xFF);
     this.out.write(paramInt >> 8 & 0xFF);
     incCount(2);
   }
   
 
 
 
   protected void incCount(int paramInt)
   {
     long l = this.written + paramInt;
     if (l < 0L) {
       l = Long.MAX_VALUE;
     }
     this.written = l;
   }
   
 
 
 
 
 
 
 
   public final long size()
   {
     return this.written;
   }
   
 
 
   public void clearCount()
   {
     this.written = 0L;
   }
 }


/* Location:              D:\Users\tianlin\Downloads\JViewer-AVIStream.jar!\com\ami\kvm\jviewer\avistream\DataChunkOutputStream.class
 * Java compiler version: 5 (49.0)
 * JD-Core Version:       0.7.1
 */